import { useEffect } from "react"
import { useDebugContext, type DebugButtonItem } from "./constants";


export const DEBUG_BUTTON_SET = new Set()

export function DebugButton(props:Omit<DebugButtonItem, 'id'>){
    const { registerButton, unregisterButton } = useDebugContext();

    useEffect(()=>{
        const buttonId = registerButton(props);
        return ()=>{
            unregisterButton(buttonId)
        }
    },[registerButton,unregisterButton])

    return null
}